package com.guo.pet_store.admin.dao;

import com.guo.pet_store.admin.pojo.PetType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface SearchRepository extends JpaRepository<PetType,Long> {
    //    查询所有为父id的type
    @Transactional
    @Query(nativeQuery = true,value = "select name from search where name like %?1% ")
    List<String> autoSearch(String content);
}
